/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cadbury;

import java.awt.Dimension;
import java.awt.Toolkit;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.*;
import javax.swing.JFrame;
import javax.swing.SwingUtilities;

/**
 *
 * @author George
 */
public class Cadbury extends JFrame {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws IOException, ClassNotFoundException {
        SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                createAndShowGUI();
            }
        });
    }

    private static void createAndShowGUI() {
        Dimension size = new Dimension();
        size = Toolkit.getDefaultToolkit().getScreenSize();
        JFrame frame = new JFrame("Cadbury");//Create and set up the window.
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        final Password newContentPane = new Password(frame);//Create and set up the content pane.
        newContentPane.setOpaque(true); //content panes must be opaque
        frame.setContentPane(newContentPane);
        frame.addWindowListener(new WindowAdapter() {
            public void windowActivated(WindowEvent e) {
                newContentPane.resetFocus();
            }
        });
        frame.setLocation((size.width/2)-100, 0);
        frame.pack();
        frame.setAlwaysOnTop(true);
        frame.setVisible(true);
    }
}
/*
 *JPanel panel = new JPanel();
            JFrame frame = new JFrame("Cadbury");
            frame.add(panel);
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.setSize(400, 400);
            frame.setVisible(true); 
 * 
 */